#ifndef __ID3DX11EFFECT_SWIG_H
#define __ID3DX11EFFECT_SWIG_H

#include "msTypes.i"
#include "IUnknown_swig.h"
#include "D3D11_swig.h"

typedef struct _D3DX11_EFFECT_DESC
{
	UINT    ConstantBuffers;        // Number of constant buffers in this effect
	UINT    GlobalVariables;        // Number of global variables in this effect
	UINT    InterfaceVariables;     // Number of global interfaces in this effect
	UINT    Techniques;             // Number of techniques in this effect
	UINT    Groups;                 // Number of groups in this effect
} D3DX11_EFFECT_DESC;

class ID3DX11EffectConstantBuffer: public ID3DX11EffectVariable
{
	STDMETHOD_(ID3DX11EffectType*, GetType)(THIS) PURE;
	STDMETHOD(GetDesc)(THIS_ D3DX11_EFFECT_VARIABLE_DESC *pDesc) PURE;

	STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByIndex)(THIS_ UINT Index) PURE;
	STDMETHOD_(ID3DX11EffectVariable*, GetAnnotationByName)(THIS_ LPCSTR Name) PURE;

	STDMETHOD_(ID3DX11EffectVariable*, GetMemberByIndex)(THIS_ UINT Index) PURE;
	STDMETHOD_(ID3DX11EffectVariable*, GetMemberByName)(THIS_ LPCSTR Name) PURE;
	STDMETHOD_(ID3DX11EffectVariable*, GetMemberBySemantic)(THIS_ LPCSTR Semantic) PURE;

	STDMETHOD_(ID3DX11EffectVariable*, GetElement)(THIS_ UINT Index) PURE;

	STDMETHOD_(ID3DX11EffectConstantBuffer*, GetParentConstantBuffer)(THIS) PURE;

	STDMETHOD_(ID3DX11EffectScalarVariable*, AsScalar)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectVectorVariable*, AsVector)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectMatrixVariable*, AsMatrix)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectStringVariable*, AsString)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectClassInstanceVariable*, AsClassInstance)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectInterfaceVariable*, AsInterface)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectShaderResourceVariable*, AsShaderResource)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectUnorderedAccessViewVariable*, AsUnorderedAccessView)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectRenderTargetViewVariable*, AsRenderTargetView)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectDepthStencilViewVariable*, AsDepthStencilView)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectConstantBuffer*, AsConstantBuffer)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectShaderVariable*, AsShader)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectBlendVariable*, AsBlend)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectDepthStencilVariable*, AsDepthStencil)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectRasterizerVariable*, AsRasterizer)(THIS) PURE;
	STDMETHOD_(ID3DX11EffectSamplerVariable*, AsSampler)(THIS) PURE;

	STDMETHOD(SetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;
	STDMETHOD(GetRawValue)(THIS_ void *pData, UINT Offset, UINT Count) PURE;

	STDMETHOD(SetConstantBuffer)(THIS_ ID3D11Buffer *pConstantBuffer) PURE;
	STDMETHOD(UndoSetConstantBuffer)(THIS) PURE;
	STDMETHOD(GetConstantBuffer)(THIS_ ID3D11Buffer **ppConstantBuffer) PURE;

	STDMETHOD(SetTextureBuffer)(THIS_ ID3D11ShaderResourceView *pTextureBuffer) PURE;
	STDMETHOD(UndoSetTextureBuffer)(THIS) PURE;
	STDMETHOD(GetTextureBuffer)(THIS_ ID3D11ShaderResourceView **ppTextureBuffer) PURE;
};

class ID3DX11Effect: public IUnknown
{
public:

	virtual BOOL IsValid( ) = 0;
	virtual HRESULT GetDevice( ID3D11Device** ppDevice) = 0;
	virtual HRESULT GetDesc(D3DX11_EFFECT_DESC *pDesc) = 0;
	virtual ID3DX11EffectConstantBuffer* GetConstantBufferByIndex(UINT Index) = 0;
	virtual ID3DX11EffectConstantBuffer* GetConstantBufferByName(char* Name) = 0;

	virtual ID3DX11EffectVariable* GetVariableByIndex( UINT Index) = 0;
	virtual ID3DX11EffectVariable* GetVariableByName(char* Name) = 0;
	virtual ID3DX11EffectVariable* GetVariableBySemantic( char* Semantic) = 0;

	virtual ID3DX11EffectGroup* GetGroupByIndex(UINT Index) = 0;
	virtual ID3DX11EffectGroup* GetGroupByName(char* Name) = 0;

	virtual ID3DX11EffectTechnique* GetTechniqueByIndex(UINT Index) = 0;
	virtual ID3DX11EffectTechnique* GetTechniqueByName(char* Name) = 0;
	virtual ID3D11ClassLinkage* GetClassLinkage() = 0;

	virtual HRESULT CloneEffect(UINT Flags, ID3DX11Effect** ppClonedEffect ) = 0;
	virtual HRESULT Optimize() = 0;
	virtual BOOL IsOptimized() = 0;
};

#endif